<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{$config_sitename}</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="__CSS__/usersh.css?t={$ver}" rel="stylesheet">
</head>
<body class="msg-pad cl-b-lgrey nofoot">
	<div class="loading-wrapper">
		<div class="loading"></div>
	</div>
	<div class="ub ub-ac page-header">
		<a href="javascript:history.back();" class="clickable"><span class="icon-back"></span></a>
		<div class="ub-f1 page-name">活跃达人</div>
		<a href="#" class="clickable-deep"><span class="icon-empty"></span></a>
	</div>
	<div id="scroll-wrapper">
		<div id="scroller">
			<ul id="thelist" class="follow-list msg-list" data-type="memberList" data-url="{:U('Index/member')}">
			<foreach name="list" item="lt">
				<li class="row ub cl-b-white clickable href-js" data-url="{:U('Ucenter/index')}?id={$lt.userid}">
					<img src="{$lt.uavatar}" class="tx-cir lazy">
					<div class="ub-f1 follow-content">
						<h3 class="f16 cl-f-dgrey msg-title">{$lt.nickname}</h3>
						<p class="f14 cl-f-grey msg-text">{$lt.fansnum}关注&nbsp;&nbsp;{$lt.worksnum}个作品</p>
					</div>
					<if condition="$lt.isfans gt 0">
					   <span class="icon-follow icon-follow-del lazy yf-follow" data-uid="{$lt.userid}" data-type="cancel"></span>
					<else/>
					   <span class="icon-follow icon-follow-add lazy yf-follow" data-uid="{$lt.userid}" data-type="add"></span>
					</if>
				</li>
			</foreach>
			</ul>
			<div class="add-loading ssp-loading">
				<div class="rect1"></div>
				<div class="rect2"></div>
				<div class="rect3"></div>
				<div class="rect4"></div>
				<div class="rect5"></div>
			</div>
		</div>
	</div>
	<script src="__JS__/jquery-1.11.1.min.js?t={$ver}"></script>
	<script src="__JS__/jquery.lazyload.min.js?t={$ver}"></script>
	<script>
    var img_url = "__IMAGES__";

    $(function(){
       	 $('#thelist').on('click', '.href-js', function(e){
          	e.preventDefault();
    		    var url = $(this).attr('data-url');
              if(url == undefined || url == '')
              {
                  return false;
              }
              location.href = url;
          });
     
        $('#thelist').on('click', '.yf-follow', function(e){
            e.preventDefault();
            e.stopPropagation();
            var _this = $(this);
            var userid = _this.attr('data-uid');
            var type = _this.attr('data-type');
            if(type == 'add')
            {
            	$.ajax({
    			    url: '/weixin/index/addfans',
    			    type: 'GET',
    			    dataType: 'json',
    			    data: {
    				    userid: userid
    			    },
    			    success: function(res)
    			    {
    			    	if(res.status == 1)
    				    {
    			    		_this.attr('data-type', 'cancel').removeClass('icon-follow-add').addClass('icon-follow-del');
    				    }
    				    else
    				    {
    					    showToast(res.info);
    					    setTimeout(function(){
		                        if(res.url)
		                        {
	                        	   location.href = res.url;
		                        }
	                        }, 1000);
    				    }
    			    },
    			    error: function(res)
    			    {
    				    showToast('系统繁忙');
    			    }
    			});
            }
            else
            {
            	$.ajax({
    			    url: '/weixin/index/cancelfans',
    			    type: 'GET',
    			    dataType: 'json',
    			    data: {
    				    userid: userid
    			    },
    			    success: function(res)
    			    {
    				    if(res.status == 1)
    				    {
    				    	_this.attr('data-type', 'add').removeClass('icon-follow-del').addClass('icon-follow-add');
    				    }
    				    else
    				    {
    					    showToast(res.info);
    					    setTimeout(function(){
		                        if(res.url)
		                        {
	                        	   location.href = res.url;
		                        }
	                        }, 1000);
    				    }
    			    },
    			    error: function(res)
    			    {
    				    showToast('系统繁忙');
    			    }
    			});
            }
        });
    });
	</script>
    <script src="__JS__/custom.js?t={$ver}"></script>
    <script src="__JS__/page.js?t={$ver}"></script>
    <script src="__JS__/common.js?t={$ver}"></script>
</body>
</html>